
#include "StdInc.h"
#include "DemoScenario.h"
#include "SampleStrategy.h"
#include "DempInstrumentStrategy.h"

namespace GSTrader
{
	namespace TradeStrategy
	{
	

		CDemoScenario::CDemoScenario(CFramework* pFramework) : CScenario(pFramework)
		{
		}


		CDemoScenario::~CDemoScenario()
		{
		}

		void CDemoScenario::ReadConfig()
		{
	
		}


		void CDemoScenario::Init()
		{
			if (m_pTradeProvider)
			{
				m_pStrategySession->AddTradeProvider(m_pTradeProvider, true);
			}

			if (m_pMarketDataProvider)
			{
				m_pStrategySession->AddMarketDataProvider(m_pMarketDataProvider);
			}
		}

		void CDemoScenario::Run()
		{
			m_pStrategy = new CDemoInstrumentStrategy(m_pStrategySession, "DemoInstrumentStrategy");
			for (size_t i = 0; i < strInstrument.size(); i++)
				m_pStrategy->AddInstrument(strInstrument[i].c_str());
	
			StartStrategy();
		}
	}
}